<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'edit';
$merch=model('jy_merch/model')->checkmerch();
if($_RQ['op']=='edit'){
	$return=array();
	$return['item']=$merch;
	exi($return);
}
if($_RQ['op']=='post'){
	$postdata=get_postdata();
	if(!$postdata['merchname']){
		exi('请填写商户名称！','error');
	}
	if(!$postdata['wechat']){
		exi('请填写商户微信号！','error');
	}
	$data=array(
		'merchname'=>trim($postdata['merchname']),
		'realname'=>trim($postdata['realname']),
		'wechat'=>trim($postdata['wechat']),
		'mobile'=>trim($postdata['mobile']),
	);
	if($merch['id']){
		pdo_update('jy_merch_user',$data,array('id'=>$merch['id'],'uniacid'=>$_SESSION['uniacid']));
	}else{
	}
	exi('操作成功！','','jy_wechatnews/home/');
}